{include file="admin@public/header"/}
<style type="text/css">
  .change{color: #337fa9;font-weight: bold;line-height: 30px;text-decoration: underline;}
  #matchCon{width: 200px;}
  .pagination{
    position: fixed;
    bottom: 0;
    z-index:1;
    width: 9999PX;
    padding-left: 18px;
  }
</style>

<body>
<div class="wrapper">
  <div class="mod-search cf"  >
    <div class="s-inner cf">
      <div class="fl"> <!-- <strong class="tit mrb fl">查询条件</strong> -->
        <div class="ui-btn-menu fl" id="filter-menu">
          <form onsubmit="return false" id="form1" class="layui-form">
          <ul class="ul-inline">
              <li class="fl">
                <input  type="date" value="" class="ui-input ui-datepicker-input" name="beginDate" id="beginDate"style="width: 125px; height: 24px; " />
                <span >至</span>
                <input type="date" value=""class="ui-input ui-datepicker-input"  name="endDate" id="endDate" style="width: 125px; height: 24px;"  />
              </li>
              <li class="fl">
                  <!-- <label for="filter-user">用户：</label> --><!-- 
                  <span class="ui-combo-wrap" id="user" > -->
                   <select name="user" id="user" class="input-txt"  style="width:200px;" >
                   	<option value="">所有用户</option>
                   	<option value="1">胡艳</option>
                   </select>
                    <span class="trigger"></span>
                  </span>
              </li> 
              <li>
                  <!-- <label for="filter-type">类型：</label> --><!-- 
                  <span class="ui-combo-wrap"  id="type"> -->

                  	<select name="users" id="users" style="width: 200px;" lay-search>
                   	<option value="">所有操作</option>
                   	<option value="查询">查询京东仓储</option>
                   	<option value="新增">新增京东仓储</option>
                   	<option value="编辑">修改京东仓储</option>
                   	<option value="删除">删除京东仓储</option>
                   	<option value="5">下载京东仓储</option>
                   </select>
                    <span class="trigger"></span>
                  </span>
              </li>
              <li>
                <input type="text" id="matchcon" name="matchcon" class="layui-input"  style="width:200px;" value="">
              </li>
              <li>
                <input type="submit" name="cx" value="查询" id="cx"  class="ui-btn ui-btn-refresh fl mrb"> 
                <!-- <a id="refresh" class="ui-btn ui-btn-refresh fl mrb"><b></b></a> <span class="txt fl" id="cur-search-tip"></span>  -->
              </li>
              <li>
                <a class="change" data-requiredright="61" id="a" tabid="setting-operationLog" rel="pageTab" href="#" onclick="dell()">切换旧版日志</a>
              </li>
          </ul>
          </form>
        </div>
      </div>
      <!-- <div class="fr"><a href="#" class="ui-btn ui-btn-sp mrb fl" id="btn-print">打印</a><a href="#" class="ui-btn fl" id="btn-export">导出</a></div> -->
    </div>
  </div>
    </div>
  </div>
  <div id="sear" class="grid-wrap">
    <table id="grid">
    </table>
    <div id="page"></div>
  </div>
</body>
<script type="text/javascript">
  $("#cx").click(function(){
  var beginDate=$("#beginDate").val();
  var endDate=$("#endDate").val();
  var user=$("#user").val();
  var users=$("#users").val();
  var matchcon=$("#matchcon").val();
  // var srt = $("#form1").serialize();//实例化表单
    $("#grid").jqGrid('setGridParam', {
        datatype: 'json',
        postData: { 'ajax': '100', 'beginDate':beginDate,'endDate':endDate,'user':user,'users':users,'matchcon':matchcon }, //发送数据 
        page: 1
      }).trigger("reloadGrid"); //重新载入 
 })
  $("#grid").jqGrid({
        url: '/system/journal/index.html?ajax=100',
        datatype: "json",//数据来源，本地数据（local，json,jsonp,xml等）
        height: '650px',//高度，表格高度。可为数值、百分比或'auto'
        //width: Public.setGrid().w,
        //height: Public.setGrid().h,
        colNames: ["日期", "用户名", "姓名", "操作类型","日志","IP"],
        colModel: [
          { name: 'journal_time',index:'journal_time' ,width: 150},
          { name: 'journal_name', index: 'journal_name', width: 200 },
          { name: 'journal_user', index: 'journal_user', width: 100},
          { name: 'journal_j', index: 'journal_j', width: 200 },
          { name: 'journal_search', index: 'journal_search', width: 300 },
          { name: 'journal_ip', index: 'journal_ip', width: 200 },

        ],
        rowNum: 90,
        rowList: [90, 60, 30],
        sortname: 'id',
        sortorder: "desc",
        pagerpos: "left",//分页位置

        pgbuttons: true,//翻页按钮
        pagination: true,
        altRows: !0,
        gridview: !0,
        shrinkToFit: !1,
        cellLayout: 8,
        autowidth: !0,
        pager: "#page",
        viewrecords: !0,
        cmTemplate: {
          sortable: !1,
          title: !1
        },
        loadError: function (t, e, i) {
          parent.Public.tips({
            type: 1,
            content: "操作失败了哦，请检查您的网络链接！"
          })
        }
      });

  //月初到当前时间的设置
  document.getElementById('endDate').valueAsDate=new Date();//当前时间赋值
  var date = new Date();//获取当前时间
  var n=date.getFullYear();//获取年
  var y=date.getMonth()+1;//获取月
  var r=date.getDate()+1;//获取日
  var yc=r-date.getDate();//获取月初
  var tody=n+"-"+y+"-"+yc;//年月日拼接
  var oldTime = (new Date(tody)).getTime();//转换日期格式
  var curTime = new Date(oldTime).format("yyyy-MM-dd");//转换日期
  document.getElementById('beginDate').value=curTime;//输出给月初的值
</script>
{include file="admin@public/footer"/}